﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcPaging;

using BMS.Models;

namespace BMS.ViewModels
{
    public class QuotationInvoiceModel
    {
        public List<QuotationModel> AvailableQuotaionsSelectedList { get; set; }
        public List<QuotationModel> RequestedQuotaionsSelectedList { get; set; }
        public InvoiceModel invoiceModel { get; set; }
        public IEnumerable<SelectListItem> fmList { get; set; }
        public IEnumerable<SelectListItem> fmListForFiltering { get; set; }
        public IEnumerable<SelectListItem> targetList { get; set; }

        public decimal RequestedTotal
        {
            get
            {
                if (RequestedQuotaionsSelectedList == null)
                    return 0;
                else
                    return RequestedQuotaionsSelectedList.Sum(quoList => quoList.TotalAmount);
            }
        }

        public String[] AvailableSelected { get; set; }
        public String[] RequestedSelected { get; set; }
        public string SavedRequested { get; set; }
    }
}